﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VH.SharePoint.Api.MetaWeblog;
using VH.SharePoint.Api.Queries;

namespace VH.SharePoint.Api
{
    public abstract class PostRepository : IRepository<Post, String>
    {
        public abstract IEnumerable<Post> FindAll();
        public abstract IEnumerable<Post> FindAll(QueryConstraints<Post> constraints);
        public abstract Post Get(string id);
        public abstract void Create(Post entity);
        public abstract void Update(Post entity);
        public abstract void Delete(Post entity);
        public abstract void ValidateUser(string username, string password);

        public virtual void Publish(Post entity, bool publish)
        {
            entity.Published = publish;
            Update(entity);
        }
    }
}
